

<template>
  <div id="app">
          <keep-alive>
            <router-view v-if="$route.meta.keepalive&&isRouterAlive" />
        </keep-alive>
            <router-view v-if="!$route.meta.keepalive&&isRouterAlive"></router-view>
  </div>
</template>

<script>
export default {
  provide () {
    return {
      reload: this.reload
    }
  },
  data () {
    return {
      isRouterAlive: true
    }
  },
  methods: {
    reload () {
      this.isRouterAlive = false
      this.$nextTick(function () {
        this.isRouterAlive = true
      })
    }
  }
}
</script>


<style lang="less" scoped >
body {
  margin: 0;
  padding: 0 ;
  box-sizing: border-box;
  background-color: #e6a1a1;
}

</style>